from django.db import models


# Create your models here.
class Student(models.Model):
    gender_choices = (
        (0, "male"),
        (1, "female"),
        (2, "other"),
    )
    username = models.CharField(max_length=80)
    password = models.CharField(max_length=80)
    gender = models.SmallIntegerField(choices=gender_choices, default=0)
    pic = models.ImageField(upload_to='pic/', default='pic/1.jpg')

    class Meta:
        db_table = "bz_student"
        verbose_name = "学生"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.username


class Teacher(models.Model):
    gender_choices = (
        (0, "male"),
        (1, "female"),
    )
    course_choices =(
        (0,'python'),
        (1,'java'),
        (2,'c++'),
        (3,'HTML'),
    )

    t_name = models.CharField(max_length=80)
    t_password = models.CharField(max_length=80)
    phone = models.CharField(max_length=11, null=True, blank=True)
    gender = models.SmallIntegerField(choices=gender_choices, default=0)
    course = models.SmallIntegerField(choices=course_choices, default=0)

    class Meta:
        db_table = 'bz_teacher'
        verbose_name = "教师"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.t_name
